<template>
	<view>
		<view>{{ props.modelValue }}</view>
		<button @click="emits('update:modelValue', props.modelValue + '1')">改变props</button>
	</view>
</template>

<script lang="ts" setup>
	import { onBeforeUnmount, onMounted, shallowRef } from 'vue';

	const props = withDefaults(defineProps<{
		modelValue : string
	}>(), {

	})

	const emits = defineEmits<{
		(e : 'update:modelValue', v : string) : void
	}>()
	
	
	onMounted(() => {
		uni.$on('getList', (value: any) => {
			console.log('拿到了数据', value);
		})
	})
	
	onBeforeUnmount(() => {
		uni.$off('getList')
	})
</script>